package com.pro.service.imple;

import com.pro.mapper.JsUserCouponMapper;
import com.pro.pojo.JsUserCoupon;
import com.pro.service.JsUserCouponService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class JsUserCouponServiceImple implements JsUserCouponService {
    @Autowired
    JsUserCouponMapper jucm;
    @Override
    public List<JsUserCoupon> getAllJsUserCoupon(JsUserCoupon param) {
        return jucm.getAllJsUserCoupon(param);
    }

    @Override
    public boolean deleteByIdJsUserCoupon(Integer couponId) {
        boolean b = jucm.deleteByIdJsData(couponId);
        if (b){
            boolean b1 = jucm.deleteByIdJsUserCoupon(couponId);
            if (b1){
                return true;
            }else{
                return false;
            }
        }else{
            return false;
        }
    }

    @Override
    public boolean updateByIdOnline(JsUserCoupon param) {
        return jucm.updateByIdOnline(param);
    }

    @Override
    public List<JsUserCoupon> selectAllcouponName() {
        return jucm.selectAllcouponName();
    }

    @Override
    public List<JsUserCoupon> selectRetrieval(JsUserCoupon param) {
        return jucm.selectRetrieval(param);
    }

    @Override
    public boolean addJsUserCoupon(JsUserCoupon param) {
        return jucm.addJsUserCoupon(param);


    }

    @Override
    public boolean addDictData(JsUserCoupon dictData) {
        return jucm.addDictData(dictData);
    }


    @Override
    public JsUserCoupon selectByIdJsUserCoupon(Integer couponCode) {
        return jucm.selectByIdJsUserCoupon(couponCode);
    }

    @Override
    public boolean updateJsUserCouponUsedUsedState(Integer couponId) {
        return jucm.updateJsUserCouponUsedUsedState(couponId);
    }

    @Override
    public JsUserCoupon getJsUserCouponById(JsUserCoupon jsUserCoupon) {
        return jucm.getJsUserCouponById(jsUserCoupon);
    }

    @Override
    public boolean updateJsUserCouponUsed(JsUserCoupon jsUserCoupon) {
        return jucm.updateJsUserCouponUsed(jsUserCoupon);
    }

    @Override
    public String getUserCouponPrice(Integer orderId) {
        return jucm.getUserCouponPrice(orderId);
    }

}
